<?php
	if(cmd('nick',50)) send('NICK ' . $msg_args[1]);
	if(cmd('join',30)) chan_join($msg_args[1]);
	if(cmd('part',30)) chan_part($msg_args[1], (count($msg_args) >= 3) ? $msg_params2 : 'Leaving');
	if(cmd('cycle',30)) {
		chan_part($msg_args[1], 'Cycling');
		chan_join($msg_args[1]);
	}
	if(cmd('quit',50)) {
		quit((count($msg_args) >= 2) ? $msg_params : 'Woof Woof!');
		die();
	}
	if(cmd('raw',50)) send($msg_params);
	if(cmd('network',50)){
		$network = $msg_params;
		$port = 6667;
		if(stristr($network, ':')){
			$temp = explode(':', $network);
			$network = $temp[0];
			$port = (int)$temp[1];
		}
		quit("Off to $network...");
	}
	if(cmd('memory')) reply('Currently using ' . memUsed() . ' of memory.');
?>